#include "Singleton.h"

#include <iostream>
using namespace std;

SingletonLazy* SingletonLazy::pSingleton = nullptr;
SingletonHungry* SingletonHungry::pSingleton = new SingletonHungry;

void test()
{
    SingletonLazy* p1 = SingletonLazy::getInstance();
    SingletonLazy* p2 = SingletonLazy::getInstance();
    if (p1 == p2) {
        cout << "Singleton Model" << endl;
    } else {
        cout << "Not Singleton Model" << endl;
    }

    SingletonHungry* p3 = SingletonHungry::getInstance();
    SingletonHungry* p4 = SingletonHungry::getInstance();
    if (p3 == p4) {
        cout << "Singleton Model" << endl;
    } else {
        cout << "Not Singleton Model" << endl;
    }
}

int main()
{
    test();
    return 0;
}